﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="/Scripts/szjt-allScripts.js" type="text/javascript"></script>
</head>
<body>
    <div id="searchCondition" formtype="query">
        <table id="Coach" class="szjt-edittable" width="100%">
            <tr>
                <td>
                    教练姓名
                </td>
                <td>
                    <input id="Coach_CoachName" type="text" class="easyui-validatebox" />
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    年龄开始值
                </td>
                <td>
                    <input id="Coach_CoachAgeStart" type="text" class="easyui-validatebox" />
                </td>
                <td>
                    年龄结束值
                </td>
                <td>
                    <input id="Coach_CoachAgeEnd" type="text" class="easyui-validatebox" />
                </td>
            </tr>
            <tr>
                <td>
                    教练性别
                </td>
                <td>
                    <select id="Coach_CoachSex" type="text" class="szjt-codecombo" category="性别">
                    </select>
                </td>
                <td>
                    教练状态
                </td>
                <td>
                    <select id="Coach_CoachStatus" type="text" class="szjt-codecombo" category="教练状态1" />
                </td>
            </tr>
        </table>
        <input id="Coach_PageIndex" type="hidden" class="easyui-validatebox" value="0" />
        <input id="Coach_PageSize" type="hidden" class="easyui-validatebox" value="10" />
    </div>
    <table id="coachList">
    </table>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#searchCondition").formpanel({
                formtype: "query",
                formTemplate: PrjConstant.Business.Coach.CoachQuery.Template,
                taskGuid: PrjConstant.SysInfo.TaskGuid,
                onExecuteComplete: function (queryResult) {
                    $("#coachList").detailgrid("loadXmlString", { xml: queryResult, totalNode: "RecordCount", dataNode: "CoachInfo" });
                    //$("#AssetList").triggerHandler("_buttonstatus");
                }
                //            onCollapse: function () {
                //                $("#AssetList").datagrid("getPanel").parent().triggerHandler("_resize");
                //            },
                //            onExpand: function () {
                //                $("#AssetList").datagrid("getPanel").parent().triggerHandler("_resize");
                //            }
            });

            $("#coachList").detailgrid({
                bizName: '教练信息',
                guidColumn: 'CoachGuid',
                nameColumn: 'CoachName',
                allowCopy: false,
                allowAdd: true,
                allowDelete: false,
                allowEdit: true,
                fit: true,
                pageSize: $("#Coach_PageSize").val(),
                columns: [[
                    { field: 'CoachGuid', title: 'GUID', hidden: true },
                    { field: 'CoachName', title: '教练姓名', width: 100 },
                    { field: 'CoachAge', title: '教练年龄', width: 100 },
                    { field: 'CoachSex', title: '教练性别', width: 100 },
                    { field: 'CoachStatus', title: '教练状态', width: 100 }
                ]],
                onAction: function (actionCode, actionName, bizName, selectedList) {
                    if (actionCode == "delete") {
                        var result = dataService.delDataList(PrjConstant.PrjTaskGuid.DriverTraining, selectedList, PrjConstant.Business.Coach.CoachInfo.DataType);
                        utility.message.promptOperationResult(actionName, bizName, (result == 0));
                    }
                    else {
                        utility.page.popupDialog({ editParameter: { actionCode: actionCode, selectedList: selectedList },
                            title: actionName + bizName, width: 600, height: 310,
                            parentTitle: utility.page.getCurrentTabTitle(),
                            href: '/Pages/Business/Coach/CoachInfo.htm'
                        });
                        // utility.page.addMainTab("教练个人信息", "/Pages/Business/Coach/CoachInfo.htm", { actionCode: actionCode, selectedList: selectedList }, "");
                    }
                },
                onSelectPage: function (pageNumber, pageSize) {
                    $("#Coach_PageIndex").val(pageNumber - 1);
                    RefreshData();
                }
            });
        });

        function RefreshData() {
            $("#searchCondition").triggerHandler("_execute");
        }
    </script>
</body>
</html>
